
package com.emser.unc.client.event;

import com.emser.unc.serializable.UserAccountDTO;
import com.google.gwt.event.shared.GwtEvent;

public class LoginEvent extends GwtEvent<LoginEventHandler> {
  public static Type<LoginEventHandler> TYPE = new Type<LoginEventHandler>();
  private final UserAccountDTO user;

  public LoginEvent(UserAccountDTO user) {
    this.user = user;
  }

  public UserAccountDTO getUser() {
    return user;
  }

  @Override public Type<LoginEventHandler> getAssociatedType() {
    return TYPE;
  }

  @Override protected void dispatch(LoginEventHandler handler) {
    handler.onLogin(this);
  }
}
